import { defineStore } from 'pinia'
import { getListApi, addListApi, eidorListApi, deleteListApi } from "@/api/staff";
export const useStaffStore = defineStore('staff', {
    state: () => {
        return {
            list: [],
            total: null,
            page: 1,
            pageSize: 5,
            pageSizes: [2, 5, 6, 10],
            query: "",
            query1: ""
        }
    },
    getters: {
    },
    actions: {
        async getList(params: Object) {
            const res = await getListApi(params)
            this.total = res.total
            this.list = res.data
        },
        addList(data: Object) {
            addListApi(data)
            // this.list=res.data
        },
        eidorList(data: Object) {
            eidorListApi(data)
            // this.list=res.data
        },
        deleteList(params: Object) {
            // console.log(params)
            deleteListApi(params)
            // this.list=res.params
        }
    }
})